import layout from "../layout/index.vue";
import { RouteRecordRaw } from "vue-router";

// 同步页面
export const RouterList: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "login",
    component: () => import("../view/login.vue"),
    meta: { hidden: true },
  },
  {
    path: "/StashECharts",
    name: "StashECharts",
    component: () => import("../view/index/StashECharts.vue"),
    meta: { hidden: true },
  },
  {
    path: "/error",
    name: "error",
    component: () => import("../view/error.vue"),
    meta: { hidden: true },
  },
  {
    path: "/Home",
    name: "Home",
    component: layout,
    redirect: "/",
    children: [
      {
        path: "/",
        name: "/",
        component: () => import("../view/index/index.vue"),
        meta: { title: "首页", icon: "icon-shouye" },
      },
      {
        path: "IndexDetils",
        name: "IndexDetils",
        component: () => import("../view/index/Detils.vue"),
        meta: { title: "详情页", hidden: true },
      },
    ],
    meta: { title: "首页", icon: "icon-shouye1" },
  },
  {
    path: "/product",
    name: "product",
    component: layout,
    redirect: "Storage",
    children: [
      {
        path: "Storage",
        name: "Storage",
        component: () => import("../view/product/index.vue"),
        meta: {
          title: "出/入库表单",
          icon: "icon-iconfontzhizuobiaozhunbduan15",
        },
      },
      {
        path: "productIndex",
        name: "productIndex",
        component: () => import("../view/product/product.vue"),
        meta: { title: "商品列表页", icon: "icon-shangpinxiangqing" },
      },
      {
        path: "productDetils",
        name: "productDetils",
        component: () => import("../view/product/Detils.vue"),
        meta: { title: "商品详情页", hidden: true },
      },
    ],
    meta: { title: "商品管理", icon: "icon-shangpin" },
  },
];

// 异步页面
export const RouteList: Array<RouteRecordRaw> = [
  {
    path: "/admin",
    name: "admin",
    component: layout,
    redirect: "AdminIndex",
    children: [
      {
        path: "AdminIndex",
        name: "AdminIndex",
        component: () => import("../view/admin/index.vue"),
        meta: { title: "首页", icon: "icon-guanliyuan" },
      },
      {
        path: "AdminSelect",
        name: "AdminSelects",
        component: () => import("../view/admin/select.vue"),
        meta: { title: "商品类别管理", icon: "icon-shangpinxiangqing" },
      },
      {
        path: "AdminStash",
        name: "AdminStash",
        component: () => import("../view/admin/stash.vue"),
        meta: {
          title: "仓库管理",
          icon: "icon-cangku_kucunxiangqingicon-cangku_kucunxiangqing",
        },
      },
    ],
    meta: { title: "管理员", icon: "icon-guanliyuan" },
  },
];
